package com.cgs.query.domain

import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import javax.persistence.*

@Entity
@ApiModel("项目锁定记录")
@Table(name = "query_project_lock")
@JsonIgnoreProperties(ignoreUnknown = true)
class ProjectLockLog : Log() {

    @Column
    @ApiModelProperty("项目名称")
    var projectName: String = ""

    @Column
    @ApiModelProperty("原锁定方式")
    var oldLockType: String = LockType.OPEN.name

    @Column
    @ApiModelProperty("新锁定方式")
    var newLockType: String = LockType.OPEN.name

}

@Entity
@ApiModel("项目异常记录")
@Table(name = "query_error_log")
@JsonIgnoreProperties(ignoreUnknown = true)
class ProjectErrorLog() : Log() {

    @Column
    @ApiModelProperty("项目名称")
    var projectName: String = ""

    @Column
    @ApiModelProperty("调用名")
    var callName: String = ""

    @Column
    @ApiModelProperty("错误信息")
    var message: String = ""

    constructor(projectName: String, callName: String, message: String) : this() {
        this.projectName = projectName
        this.message = message
        this.callName = callName
    }
}